#ifndef QLS_AV_DEMO_SERVICE_H
#define QLS_AV_DEMO_SERVICE_H

#include <QObject>
#include <QMutex>
#include <QMetaObject>

#include <plugins_manager/qls_interface.h>

#include "qls_av_demo.h"

class QLsAVDemoService : public QObject, public QLsPluginService
{
    Q_OBJECT

    /* 宏注册信息 */
#if QT_VERSION > 0x050000 //定义到Qt5
    /* 接口声明 */
    Q_INTERFACES(QLsPluginService)
    /* Q_PLUGIN_METADATA宏用于描述插件元数据 */
    Q_PLUGIN_METADATA(IID QLsPluginService_iid FILE "AVDemo.json")
#endif // QT_VERSION < 0x050000

public:
    explicit QLsAVDemoService(QObject *parent = nullptr);
    ~QLsAVDemoService();

    /* 返回一个Widget设置到centerwidget中进行显示 */
    virtual QWidget *createView() override;

private:
    static QMutex g_centerMutex;
    static QLsAVDemo *g_centerWidget;
};

#endif // QLS_AV_DEMO_SERVICE_H
